//AD  <- Needed to identify//
//--automatically built--
//--Project: canon_hd.js
var app = new Avidemux();

//** Video **
// 01 videos source
app.load("a_file.mov");
//01 segments
app.clearSegments();
app.addSegment(0, 0, 631);
app.markerA = 0;
app.markerB = 630;

//** Postproc **
app.video.setPostProc(3, 3, 0);

app.video.fps1000 = 30000;

//** Filters **
app.video.addFilter("mpresize", "w=768", "h=432", "algo=0");

//** Video Codec conf **
app.video.codecPlugin("32BCB447-21C9-4210-AE9A-4FCE6C8588AE", "x264", "AQ=22", [
    "<?xml version='1.0'?>",
    "<x264Config>",
    "    <presetConfiguration>",
    "        <name>canon_hd</name>",
    "        <type>user</type>",
    "    </presetConfiguration>",
    "    <x264Options>",
    "        <threads>0</threads>",
    "        <deterministic>true</deterministic>",
    "        <idcLevel>-1</idcLevel>",
    "        <vui>",
    "            <sarAsInput>true</sarAsInput>",
    "            <sarHeight>1</sarHeight>",
    "            <sarWidth>1</sarWidth>",
    "            <overscan>undefined</overscan>",
    "            <videoFormat>undefined</videoFormat>",
    "            <fullRangeSamples>false</fullRangeSamples>",
    "            <colorPrimaries>undefined</colorPrimaries>",
    "            <transfer>undefined</transfer>",
    "            <colorMatrix>undefined</colorMatrix>",
    "            <chromaSampleLocation>0</chromaSampleLocation>",
    "        </vui>",
    "        <referenceFrames>3</referenceFrames>",
    "        <gopMaximumSize>250</gopMaximumSize>",
    "        <gopMinimumSize>25</gopMinimumSize>",
    "        <scenecutThreshold>40</scenecutThreshold>",
    "        <bFrames>16</bFrames>",
    "        <adaptiveBframeDecision>1</adaptiveBframeDecision>",
    "        <bFrameBias>0</bFrameBias>",
    "        <bFrameReferences>1</bFrameReferences>",
    "        <loopFilter>true</loopFilter>",
    "        <loopFilterAlphaC0>0</loopFilterAlphaC0>",
    "        <loopFilterBeta>0</loopFilterBeta>",
    "        <cabac>true</cabac>",
    "        <interlaced>false</interlaced>",
    "        <cqmPreset>flat</cqmPreset>",
    "        <intra4x4Luma>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "        </intra4x4Luma>",
    "        <intraChroma>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "        </intraChroma>",
    "        <inter4x4Luma>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "        </inter4x4Luma>",
    "        <interChroma>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "        </interChroma>",
    "        <intra8x8Luma>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "        </intra8x8Luma>",
    "        <inter8x8Luma>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "            <value>16</value>",
    "        </inter8x8Luma>",
    "        <analyse>",
    "            <partitionI4x4>true</partitionI4x4>",
    "            <partitionI8x8>true</partitionI8x8>",
    "            <partitionP8x8>true</partitionP8x8>",
    "            <partitionP4x4>false</partitionP4x4>",
    "            <partitionB8x8>true</partitionB8x8>",
    "            <dct8x8>true</dct8x8>",
    "            <weightedPrediction>true</weightedPrediction>",
    "            <directPredictionMode>auto</directPredictionMode>",
    "            <chromaLumaQuantiserDifference>0</chromaLumaQuantiserDifference>",
    "            <motionEstimationMethod>hexagonal</motionEstimationMethod>",
    "            <motionVectorSearchRange>16</motionVectorSearchRange>",
    "            <motionVectorLength>-1</motionVectorLength>",
    "            <motionVectorThreadBuffer>-1</motionVectorThreadBuffer>",
    "            <subpixelRefinement>7</subpixelRefinement>",
    "            <chromaMotionEstimation>true</chromaMotionEstimation>",
    "            <mixedReferences>true</mixedReferences>",
    "            <trellis>finalMacroblock</trellis>",
    "            <fastPSkip>true</fastPSkip>",
    "            <dctDecimate>true</dctDecimate>",
    "            <noiseReduction>0</noiseReduction>",
    "            <interLumaDeadzone>21</interLumaDeadzone>",
    "            <intraLumaDeadzone>11</intraLumaDeadzone>",
    "        </analyse>",
    "        <rateControl>",
    "            <quantiserMinimum>10</quantiserMinimum>",
    "            <quantiserMaximum>51</quantiserMaximum>",
    "            <quantiserStep>4</quantiserStep>",
    "            <averageBitrateTolerance>1</averageBitrateTolerance>",
    "            <vbvMaximumBitrate>0</vbvMaximumBitrate>",
    "            <vbvBufferSize>0</vbvBufferSize>",
    "            <vbvInitialOccupancy>0</vbvInitialOccupancy>",
    "            <ipFrameQuantiser>1</ipFrameQuantiser>",
    "            <pbFrameQuantiser>1</pbFrameQuantiser>",
    "            <adaptiveQuantiserMode>variance</adaptiveQuantiserMode>",
    "            <adaptiveQuantiserStrength>1</adaptiveQuantiserStrength>",
    "            <quantiserCurveCompression>0</quantiserCurveCompression>",
    "            <reduceFluxBeforeCurveCompression>20</reduceFluxBeforeCurveCompression>",
    "            <reduceFluxAfterCurveCompression>0</reduceFluxAfterCurveCompression>",
    "        </rateControl>",
    "        <accessUnitDelimiters>false</accessUnitDelimiters>",
    "        <spsIdentifier>0</spsIdentifier>",
    "    </x264Options>",
    "</x264Config>"
        ]);

//** Audio **
app.audio.reset();
app.audio.codec("Faac", 96, 4, "60 00 00 00 ");
app.audio.normalizeMode = 0;
app.audio.normalizeValue = 0;
app.audio.delay = 0;
app.audio.mixer = "NONE";
app.setContainer("MP4");
setSuccess(1);
//app.Exit();
//End of script
